﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>登录</title>
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="css/ydui.css?v=1.1.4" rel="stylesheet" />
    <script src="js/ydui.flexible.js"></script>
	<link rel="stylesheet" type="text/css" href="css/all.css?v=20180302"/>
    <style>
        .cell-item{padding-left:0;}
        .cell-item .iconfont {
            color: #ff8a00;
            font-size: 18px;
            margin-right: 5px;
            padding-right: 5px;
            border-right: 1px solid #E7E7E7;
        }

        .m-cell:after {
            border-bottom: none;
        }

        /*.cell-item:not(:last-child):after {
            border: none;
        }*/

        .other_login {
            color: #bbbbbb;
            font-size: .26rem;
            text-align: center;
            position: relative;
            margin-top: 0.6rem;
        }

            .other_login:before {
                content: "";
                position: absolute;
                width: 1.83rem;
                border-bottom: 1px solid #E7E7E7;
                right: 0;
                top: .15rem;
            }

            .other_login:after {
                content: "";
                position: absolute;
                width: 1.83rem;
                border-bottom: 1px solid #E7E7E7;
                left: 0;
                top: .15rem;
            }
            .cell-item .iconfont{border:none;text-align:center;}
            .btn-hollow{border: 1px solid #04BE02;color: #04BE02;}
            .btn-hollow:after{border:none}
            .noborder:after{border:none !important;}

    </style>
    
</head>
<body ms-controller="indexview" class="ms-controller" style="background-color:#fff;">
    <section class="g-flexview">
        <header class="m-navbar">
            <div class="navbar-center">
                <span class="navbar-title">登录</span>
               
            </div>
        </header>
        <section class="g-scrollview">
            <!--<img src="img/LOGON.bmp" style=" height:200px; width:100%; margin-top:0px;" />-->
            <div class="m-cell" style="padding:10px;margin-top:10px;">

                <div class="cell-item">
                    <div class="cell-left"><i class="iconfont icon-shouji"></i></div>
                    <div class="cell-right"><input type="text" class="cell-input" placeholder="请输入用户名" ms-duplex="@ModelData.Telephone" /></div>
                </div>
                <div class="cell-item">
                    <div class="cell-left"><i class="iconfont icon-mima"></i></div>
                    <div class="cell-right">
                        <input type="password" class="cell-input" placeholder="请输入密码" ms-duplex="@ModelData.Password" />
                        <!--<a href="javascript:;" class="btn btn-primary" id="J_GetCode">获取手机验证码</a>-->
                    </div>
                </div>
                <div class="cell-item noborder">
                    <button type="button" class="btn-block btn-hollow" ms-on-tap="@Login()">登录</button>
                </div>


            </div>

        </section>

    </section>
    <script src="https://cdn.bootcss.com/jquery/2.2.0/jquery.min.js"></script>
    <script src="js/ydui.js"></script>
    <script src="js/avalon.mobile.min.js"></script>
    <script src="js/ComFunJS.js?v=201803072"></script>
    <script>

        
        var model = avalon.define({
            $id: "indexview",
            ModelData: { "Telephone": "", "Password": "" },
            Login: function () {

                if (!model.ModelData.Telephone || !model.ModelData.Password) {
                    YDUI.dialog.toast("请输入用户名和密码", 'none', 1500);
                    return;
                }

                if (model.ModelData.Telephone == "sender") {
                    window.location.href = "order/senderinfo.html";
                }
                else if (model.ModelData.Telephone == "car") {
                    window.location.href = "driver/orderlist.html";
                }
                else if (model.ModelData.Telephone == "company") {
                    window.location.href = "order/orderlist.html";
                }


                //$.post("/api/user/login", model.ModelData.$model, function (r) {
                    
                //    if (r.error == "") {
                //        YDUI.dialog.toast("登录成功", 'success', 1500, function () {
                //            ComFunJS.saveToken(model.ModelData.Telephone);
                           
                //            window.location.href = "index.html";
                //        })
                        
                //    } else {
                //        YDUI.dialog.toast(r.error, 'none', 1500);
                //    }
                    
                //})

                //$.getJSON("/api/user/report/1", { username: "11" }, function (r) {
                //    if (r.error == "") {

                //    }
                //    else {
                //        YDUI.dialog.toast(r.error, 'none', 1500);
                //    }
                //})
                
            }

        });
        avalon.ready(function () {
            
            //if (ComFunJS.isLogin(true)) {
            //    // YDUI.dialog.toast("正在登陆...", 'none', 2500);
                
            //         window.location.href = "index.html";
            //}
        })
       
    </script>
</body>
</html>
